#include<bits/stdc++.h>
using namespace std;
int a[100010],n,summ=0;
bool f[100010],f1[100010];
int b[100010];
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    while(1){
        bool f2=false;
        for(int i=1;i<=n;i++){
            if(f[i]==false&&f1[i]==false){
                f2=true;
                break;
            }
        }
        if(f2==false){
            break;
        }
        int minn1=1e9,t1,minn2=1e9,t2;
        for(int i=1;i<=n;i++){
            if(a[i]==0x3f3f3f3f||f[i]==true) continue;
            if(a[i]<minn1){
                minn2=minn1;
                t2=t1;
                minn1=a[i];
                t1=i;
            }
            else if(a[i]<minn2&&a[i]!=minn1){
                minn2=a[i];
                t2=i;
            }
        }
        if(minn1==1e9||minn2==1e9){
            break;
        }
        a[t1]=0x3f3f3f3f;
        f[t2]=true;
        f1[t1]=true;
    }
    for(int i=1;i<=n;i++){
        if(f1[i]==false){
            summ++;
        }
    }
    cout<<summ<<endl;
    return 0;
}
